<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0050)http://otter-rsch.com/admbre/examples/nbmm/nbmm.html -->
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2604" name=GENERATOR></HEAD>
<BODY><BR>
<TABLE cellSpacing=2 cellPadding=2 align=center border=0>
  <TBODY>
  <TR>
    <TD align=middle colSpan=2>
      <DIV align=center>
      <H1>glmmADMB: <br>
	   Mixed models for discrete data in R -- powered by AD Model Builder
	     </H1></DIV><BR><BR></TD></TR>
  <TR>
 
    <TD width="30%">
      <TABLE cellSpacing=0 cellPadding=2 width="90%" bgColor=#359163 border=0>
      

        <TR>
          <TD align=middle><FONT face="Arial, Helvetica" 
            color=white><B>Installing and using glmmADMB in R</B></FONT> </TD></TR>
        <TR>
          <TD>
            <TABLE cellSpacing=0 cellPadding=3 width="100%" bgColor=#ffffff 
            border=0>
              <TBODY>
              <TR>
                <TD>			  
             Under windows: 
			 <ol>
	      <li> Download <A href="glmmADMB.zip">glmmADMB.zip</A>.
	      <li> On the "Packages" menu in R, choose "Install package(s) from local zip file..." 
		</ol>
             Under linux: 
			 <ol>
	      <li> Download <A href="glmmADMB_0.3.tar.gz">glmmADMB_0.3.tar.gz</A>.
	      <li> Consult the <A href="http://lib.stat.cmu.edu/R/CRAN/doc/manuals/R-admin.html">
		  	R Installation and Administration manual</A> on how to install the package.
		</ol>
		Using the package in R:<br>
		 <ol>
	      <li> library("glmmADMB") to load the package into R
	      <li> help("glmm.admb") and see example at the bottom of the help page.
		</ol>
 			  Note that the ADMB-RE executables create temporary files (sometimes large), so you should start R in a 
			  specially dedicated directory. 
			  <br>

        </FONT></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE><BR>

        <TABLE cellSpacing=0 cellPadding=2 width="90%" bgColor=#359163 border=0>


        <TR>
          <TD align=middle><FONT face="Arial, Helvetica" 
            color=white><B>Source code</B></FONT> </TD></TR>
        <TR>
          <TD>
            <TABLE cellSpacing=0 cellPadding=3 width="100%" bgColor=#ffffff 
            border=0>
              <TBODY>
              <TR>
                <TD>			  
			  Source code: glmmADMB includes two binaries ("nbmm" and "bvprobit"). On request from
			  R-users we make the (AD Model Builder) source code for these available here:
			  <A href="nbmm.tpl">nbmm.tpl</A> and <A href="bvprobit.tpl">bvprobit.tpl</A>. (In order
			  to compile the tpl-files you need to buy AD Model Builder.)

        </FONT></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE><BR><br>
		<br>


      <TABLE cellSpacing=0 cellPadding=2 width="90%" bgColor=#359163 border=0>


        <TR>
          <TD align=middle><FONT face="Arial, Helvetica" 
            color=white><B>ADMB User Forum</B></FONT> </TD></TR>
        <TR>
          <TD>
            <TABLE cellSpacing=0 cellPadding=3 width="100%" bgColor=#ffffff 
            border=0>
              <TBODY>
              <TR>
                <TD>			  
				Questions relating to the R-package should be posted to the 
				<A href="http://www.otter-rsch.ca/phpbb/">ADMB user forum</A> 
				under the topic "ADMB NBMM for R"<br>
				

        </FONT></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE><BR><br>
		<br>

      <TABLE cellSpacing=0 cellPadding=2 width="90%" bgColor=#359163 border=0>
        <TR>
          <TD align=middle><FONT face="Arial, Helvetica" 
            color=white><B>Navigation</B></FONT> </TD></TR>
        <TR>
          <TD>
            <TABLE cellSpacing=0 cellPadding=3 width="100%" bgColor=#ffffff 
            border=0>
              <TBODY>
              <TR>
                <TD>			  
				<A href="http://otter-rsch.com/admbre/admbre.html">ADMB-RE home</A> <br>
                <A href="http://otter-rsch.com/">Otter Research</A> <br>
				

        </FONT></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE><BR><br>
		<br>
		
      <TABLE cellSpacing=0 cellPadding=2 width="90%" bgColor=#359163 border=0></TABLE>


   </TD>
				
    <TD width="75%">
	

	  Zero-inflation and overdispersion currently receive much attention in the statistical literature, e.g:<br><br>
	  
	  <em>For count responses, the situation of excess zeros (relative to what standard models allow) often 
	  occurs in biomedical and sociological applications. Modeling repeated measures of zero-inflated count 
	  data presents special challenges. This is because in addition to the problem of extra zeros, 
	  the correlation between measurements upon the same subject at different occasions needs to be taken into 
	  account.</em><br>
	  <p align="right">Min and Agresti (2005), 
      <A href="http://www.ingentaconnect.com/content/arn/st/2005/00000005/00000001"> Statistical modelling</A>
	  </p>

	  The <A href="http://www.r-project.org/">R</A>-package <TT>glmmADMB</TT> provides a GLMM framework (in
	  the spirit of  <TT>glmmPQL</TT> and <TT>GLMM</TT>) with:
	  <ul>
	  <li>Negative binomial or Poisson responses.</li>
	  <li>Zero-inflation, e.g. a mixture of a Poisson or negative binomial distribution and a point mass at zero. 
	  </ul>

	  In addition it is possible to fit data with Bernoulli response (0 or 1):
	  <ul>
	  <li>Logistic or probit link function</li>
	  </ul>
	  
	  <TT>glmmADMB</TT> is developed using <A href="http://otter-rsch.com/admbre/admbre.html">ADMB-RE</A>, but the full unrestricted 
	  R-package is made freely available and does not require ADMB-RE to run with user supplied data.

 	  <h2>Likelihood approximation</h2>
      By default <TT>glmm.admb()</TT> uses the Laplace approximation, which is beleived to be superior to
	  the PQL method used by other mixed model routines in R. Hence, the likelihood values returned 
	  by <TT>glmm.admb()</TT> can be used construct the AIC criterion for model comparison, and to perform likelihood
	  ratio tests. For situations where the Laplace approximation is not accurate enough, importance sampling
	  is an option of <TT>glmm.admb()</TT>.

	  <h2>Beyond the standard GLMM framework</h2>
	  <A href="http://otter-rsch.com/admbre/admbre.html">ADMB-RE</A> provides a full
	  programming language for random effects modeling. The code for <TT>glmmADMB</TT> is 
	   <A href="nbmm.tpl">nbmm.tpl</A>. Using ADMB-RE it is easy to modify <TT>nbmm.tpl</TT> to non-standard 
	   situations, such as:
	  <ul>
	  <li> zero-inflation with P(zero) depending on covariates. </li>
	  <li> Distributions of different types: e.g. response <em>(X,Y)</em> with <em>X</em> Bernoulli and <em>Y</em> Poisson. 
	  <li> Crossed random effects.
	  </li>
	  </ul>
	  Details and examples of how to build ADMB-RE programs can be found here: <A href="http://otter-rsch.com/admbre/admbre.pdf">user manual</A>.
	  <br>
	  
	  </TD><BR>  </TR></TBODY></TABLE></BODY></HTML>
